package net.wanho.zaixian.cms.controller;

import com.alibaba.fastjson.JSONObject;
import net.wanho.zaixian.cms.service.CmsSiteService;
import net.wanho.zaixian.pojo.cms.CmsSite;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class SiteController {
    @Resource
    private CmsSiteService cmsSiteService;

    /**
     * 查询所有的站点
     * @return
     */
    @GetMapping("/cms/site/list")
    public JSONObject getAllSite(){
        List<CmsSite> cmsSiteList = cmsSiteService.getAllSite();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("cmsSiteList",cmsSiteList);
        return jsonObject;

    }

}
